package com.journey.controller.system;

import com.journey.controller.constant.SessionKeyConst;
import com.journey.dto.MenuDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * Created by ADMIN on 2018/6/12.
 */
@Controller
@RequestMapping("/session")
public class SessionController {
    @Autowired
    private HttpSession session;

    @RequestMapping(value = "/menus" , method  = RequestMethod.GET)
    @ResponseBody
    public List<MenuDto> getUserMenuList(MenuDto menuDto) {
        return (List<MenuDto>)session.getAttribute(SessionKeyConst.MENU_INFO);
    }
}
